home *** CD-ROM | disk | FTP | other *** search
/ Hottest 6 / Hottest 6 (1996)(PDSoft)[!].iso / software / fredfish / 1092.lha / Programs / ErrorMsg / Rexx / ShowERM.rexx < prev   
OS/2 REXX Batch file  |  1994-06-15  |  2KB  |  72 lines

  1. /* demo program for errormsg.library's arexx functions */
  2. /*******************************************************/
  3. /*                                                     */
  4. /* $VER: rexx:ShowERM.rexx V1.0 (15.06.94)             */
  5. /*                                                     */
  6. /* Requires errormsg.library V2.0+ (of course)         */
  7. /*                                                     */
  8. /* ©1994 F.Delacroix, fully public domain              */
  9. /*                                                     */
  10. /*******************************************************/
  11.  
  12. /* Make sure errormsg.library is available */
  13. IF ~SHOW('Libraries','errormsg.library') THEN
  14.  IF ~ADDLIB('errormsg.library',0,-60,2) THEN RETURN 20
  15.  
  16. say "This is an ARexx program that shows the ARexx capacities of"
  17. say "the errormsg.library V2.0+ ." || "0A"X
  18. say " For the menues 4,5 and 6 to work, you'll have to install"
  19. say " the program named ERMID.rexx into your REXX: directory." || "0A"X
  20. say "Press Return to continue..." || "0A"X
  21. say "Frédéric Delacroix"
  22. say "5 rue d'Artres"
  23. say "59269 Querenaing"
  24. say "France."
  25. pull .
  26.  
  27. /* Initialize the menu string */
  28. menu='0c'X ||,
  29. '    1. Enter error code' || '0A'X ||,
  30. '    2. Enter system code' || '0A'X ||,
  31. '    3. Enter subsystem code' || '0A'X ||,
  32. '    4. Get number for error code' || '0A'X ||,
  33. '    5. Get number for system code' || '0A'X ||,
  34. '    6. Get number for subsystem code' || '0A'X ||,
  35. '    7. Show message' || '0A'X ||,
  36. '    8. Display message' || '0A'X ||,
  37. '    9. Alert message' || '0A'X ||,
  38. '    0. Exit' || '0A 0A'X
  39. Code=0; System=0; SubSystem=0
  40.  
  41. /* Show the menu */
  42. do until choice=0
  43.     say    menu
  44.     say    'Code: ' Code 'System:' System 'SubSystem:' SubSystem
  45.     pull    Choice .
  46.     select
  47.         when    choice=1 then do
  48.             say "Enter error code:"
  49.             pull code
  50.             end
  51.         when    choice=2 then do
  52.             say "Enter system code:"
  53.             pull system
  54.             end
  55.         when    choice=3 then do
  56.             say "Enter subsystem code:"
  57.             pull subsystem
  58.             end
  59.         when    choice=4 then code=ERMID(code)
  60.         when    choice=5 then system=ERMID(system)
  61.         when    choice=6 then subsystem=ERMID(subsystem)
  62.         when    choice=7 then do
  63.             say "Error message is:" geterrormsg(code,system,subsystem);
  64.             say "Press Return to continue."
  65.             pull .
  66.             end
  67.         when    choice=8 then call displayerrormsg(code,system,subsystem,,'Error message',,)
  68.         when    choice=9 then call alerterrormsg(code,system,subsystem)
  69.         otherwise    nop
  70.     end
  71. end
  72.